close, clear, clc
I = 0;
N = 1000;
dTheta = 2*pi/N;
R = 1;
% z = Re^(i*Theta)
for k=1:N
    Theta = 2*pi*k/N;
    dz = i*R*exp(Theta*i)*dTheta;
    z = R * exp(i*Theta); 
    f = cos(z)/z*dz;
    I = I + f;
end
